package com.wan.activity;

import com.wan.commonsdk.WanCommonSdk;

import net.sourceforge.simcpux.Util;
import android.content.res.Configuration;
import android.content.res.Resources.Theme;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;

public class WANSLogoActivity extends BaseActivity{
	ImageView img;
	
	
	Handler mHandler = new Handler(){
		public void handleMessage(android.os.Message msg) {
			
			WanCommonSdk.getInstance().initWanApp();
			finish();
		};
		
	};
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(Util.getResID("wan51_logo_activity", "layout"));
		img = (ImageView) findViewById(Util.getResID("wan51_sl_img", "id"));
		Configuration mConfiguration = getResources()
				.getConfiguration(); // 获取设置的配置信息
		int ori = mConfiguration.orientation; // 获取屏幕方向
//		View mview = View.inflate(activity,
//				Util.getResID("wan51_pop_imgview", "layout"), null);
		
		
//		Conet.mPopupwindow = new PopupWindow(mview, width, height);
		
		
		if (ori == Configuration.ORIENTATION_LANDSCAPE) {
//			Drawable drawable = activity.getResources().getDrawable(Util.getResID("wan51_logo_land", "drawable"));
//			Conet.mPopupwindow.setBackgroundDrawable(drawable);
			img.setBackgroundResource(Util.getResID("wan51_logo_land", "drawable"));
			
		} else if (ori == Configuration.ORIENTATION_PORTRAIT) {
//			mview.setBackgroundResource(Util.getResID("wan51_logo_org", "id"));
//			Drawable drawable = activity.getResources().getDrawable(Util.getResID("wan51_logo_org", "drawable"));
//			Conet.mPopupwindow.setBackgroundDrawable(drawable);
			img.setBackgroundResource(Util.getResID("wan51_logo_org", "drawable"));
		}
//		
		new Thread(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					Thread.sleep(3000);
					mHandler.sendEmptyMessage(0);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}).start();
	}
}
